﻿using Smobiler.Core;
using Smobiler.Core.Controls;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DAL;
using Model;
namespace FubiManger.UI
{
    partial class EditPwdForm : Smobiler.Core.Controls.MobileForm
    {
        public EditPwdForm() : base()
        {
            //This call is required by the SmobilerForm.
            InitializeComponent();
        }
        /// <summary>
        /// 商户号
        /// </summary>
        public string merchantid { get; set; }
        /// <summary>
        /// 账号
        /// </summary>
        public string account { get; set; }
        /// <summary>
        /// 昵称
        /// </summary>
        public string nickname { get; set; }
       
        bool match = false;
        private void panclose_Press(object sender, EventArgs e)
        {
            this.Close();
        }

        private void pansave_Press(object sender, EventArgs e)
        {
            if (match == true)
            {
                string pwd = AesUtil.EncryptString(txtpwd1.Text);

                if (adminsDal.Updatepwd(pwd, account) > 0)
                {
                    Toast("密码修改成功");
                    this.Form.RemoveClientData("merchantid");
                    this.Client.ReStart();
                }

            }
        }

        private void txtpwd1_TouchLeave(object sender, EventArgs e)
        {
            if (txtpwd1.Text != txtpwd.Text)
            {
                lbldes.Visible = true;
                match = false;
            }
            else
            {
                lbldes.Visible = false;
                match = true;
            }
        }
    }
}